package com.cloud.servlet;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloud.core.BaseServlet;
import com.cloud.core.emchat.ChatAdmin;

/**
 * 1Cloud1
 * @author Administrator
 * @since 2015-11-14
 * @version 1.0 
 */
@Controller
@RequestMapping("/chat")
public class ChatServlet extends BaseServlet {
	@Autowired
	private ChatAdmin ChatAdmin;
	
	/**
	 * 查询历史消息
	 * @param request
	 * @param lastTime
	 * @return
	 */
	@RequestMapping(value = "/message", method = { RequestMethod.GET})
	public @ResponseBody String message(HttpServletRequest request, String lastTime) {
		return ChatAdmin.getChatMessages(lastTime).toString();
	}
}
